1: PdfSecurityOptions securityOptions = new PdfSecurityOptions();
2:
3: securityOptions.CanAssembleDocument = canAssembleDocument;
4: securityOptions.CanCopyContent = canCopyContent;
5: securityOptions.CanEditAnnotations = canEditAnnotations;
6: securityOptions.CanEditContent = canEditContent;
7: securityOptions.CanFillFormFields = canFillFormFields;
8: securityOptions.CanPrint = canPrint;
9: securityOptions.KeySize = keySize;
10: securityOptions.UserPassword = userPassword;
11: securityOptions.OwnerPassword = ownerPassword;
12:
13: PdfSecurityManager securityManager =
new PdfSecurityManager(securityOptions);
14:
15: if (removeSecurity)
16: securityManager.SaveUnSecuredPdfToFile(srcPdfFile, outFile, removeSecurityPswd);
17: else
18: securityManager.SaveSecuredPdfToFile(srcPdfFile, outFile);